home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-06 | 2.4 KB | 100 lines | [TEXT/KAHL] |
- /******************************************************************************
- CAboutDirector.c
-
-
- SUPERCLASS = CDLOGDirector
-
- Copyright © 1991 Symantec Corporation. All rights reserved.
-
-
- ******************************************************************************/
-
- #include "CAboutDirector.h"
- #include <CScrollPane.h>
- #include <CDialogText.h>
- #include <CDialog.h>
- #include <CPaneBorder.h>
- #include <CApplication.h>
- #include <CTextEnvirons.h>
-
- static Boolean ByKind( CView *scrollPane, void* targetID)
- {
- return member(scrollPane, CScrollPane);
- }
-
- void CAboutDirector::IAboutDirector( short Aboutid, CDirectorOwner *aSupervisor)
- {
- CScrollPane *scrollPane;
- Handle Data = GetResource( 'TEXT', Aboutid);
- Str255 name;
- ResType rType;
- FailNILRes(Data);
- GetResInfo(Data,&Aboutid,&rType,name);
-
- CDLOGDirector::IDLOGDirector( Aboutid, aSupervisor);
-
- itsData = Data;
- itsWindow->SetTitle(name);
- scrollPane = (CScrollPane *)itsWindow->MatchView( ByKind, 0);
-
- if (scrollPane)
- {
- StScrpHandle styleHandle = (StScrpHandle) GetResource( 'styl', Aboutid);
- CPaneBorder *listBorder;
- Rect margin;
- Cell aCell;
-
- itsMainPane = new(CStyleText);
- itsGopher = itsMainPane;
-
- itsMainPane->IStyleText(scrollPane, this,
- 1, 1, 0, 0, sizELASTIC, sizELASTIC, 1000);
- itsMainPane->Specify( kNotEditable, kNotSelectable, kNotStylable);
- itsMainPane->FitToEnclosure(TRUE, TRUE);
- itsMainPane->Offset( 2, 2, FALSE);
- SetRect(&margin, 0, 0, -2, -2);
- itsMainPane->ChangeSize( &margin, FALSE);
-
- if (Data) itsMainPane->SetTextHandle(Data);
-
- // Install the styles
-
- if (styleHandle) itsMainPane->SetStyleScrap( 0, MAXINT, styleHandle, TRUE);
-
- scrollPane->InstallPanorama(itsMainPane);
-
- }
- } /* CAboutDirector::IAboutDirector */
-
-
- void CAboutDirector::Dispose( void)
- {
- itsMainPane = 0;
- inherited::Dispose();
- }
-
- void CAboutDirector::DoCommand( long theCommand)
- {
- Handle Data = NULL;
- StScrpHandle styleHandle = NULL;
-
- switch( theCommand)
- {
- case 301: case 302: case 303: case 304: case 305: case 306: case 307:
- case 401: case 402: case 403: case 404: case 405: case 406: case 407:
- Data = GetResource('TEXT', (short)theCommand);
- styleHandle = (StScrpHandle) GetResource( 'styl', (short)theCommand);
- break;
- default:
- inherited::DoCommand( theCommand);
- break;
- }
-
- if (Data)
- {
- itsData = Data;
- itsMainPane->SetTextHandle(Data);
- if (styleHandle) itsMainPane->SetStyleScrap( 0, MAXINT, styleHandle, TRUE);
- }
- }
-